package com.cjyd.hrjb.utils;

import java.time.Instant;
import java.util.Calendar;
import java.util.Date;

/**
 * Created fei wo by 2020/4/9
 */
public class DateUtil {
    private static final Calendar calender = Calendar.getInstance();

    public static Instant todayBeginDate() {
        calender.set(calender.get(Calendar.YEAR), calender.get(Calendar.MONTH), calender.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
        return Instant.ofEpochMilli(calender.getTime().getTime());
    }

    public static Instant todayEndDate() {
        calender.set(calender.get(Calendar.YEAR), calender.get(Calendar.MONTH), calender.get(Calendar.DAY_OF_MONTH), 23, 59, 59);
        return Instant.ofEpochMilli(calender.getTime().getTime());
    }
}
